package com.gxa.ehome.busiCodeEnum;

//枚举类型：对象类型
//可以添加字段/构造/bean方法
//最重要的是枚举的实例

/*class Name{
    public static String Zhang="";
    public static String Zhang="";
    public static String Zhang="";
}*/

//作用：制定备选的异常和异常信息

public enum ErrorCode {

    //枚举的实例：设计时应当全大写（单词的简写）


    NULL_OBJ("001","对象为空值"),
    USERNAME_EXISTS("002","用户名重复"),
    LOGIN_FAILED("003","登录失败,用户名或密码不正确");

    private String code;
    private String desc;
    private ErrorCode(String code,String desc){
        this.code=code;
        this.desc=desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Override
    public String toString() {
        return "ErrorCode{" +
                "code='" + code + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}
